<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>工程竣工验收 - 编写竣工验收监督报告</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="/static/css/buildUnit/common.css">
    <style>
        body {
            height: auto;
        }

        .content {
            padding: 20px;
        }
        .layui-container {
            padding-top: 20px;
            width: auto;;
        }

        /*单元格备注样式*/
        .layui-table td.tdBz {
            text-align: left;
            padding-left: 0;
            border-left: none;
            color: #aaa;
        }

        .padNone .layui-form-select .layui-input {
            padding-right: 0;
        }

        .hide {
            display: none;
        }

        #superviseStartDate{
            width: 40%;
            display: inline-block;
        }

        #superviseEndDate{
            width: 40%;
            display: inline-block;
        }
        #auditDate{
            width: 40%;
            display: inline-block;
        }
    </style>
</head>
<body>
<div class="layui-container">

    <form id="form2" class="layui-form layui-form-pane" action="" lay-filter="example2">
    <!--基本情况-->
    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">基本情况</h2>
            <div class="layui-colla-content layui-show">
                <table class="layui-table v-table">
                    <tbody>
                    <tr class="hide">
                        <td width="24%"></td>
                        <td width="13%"></td>
                        <td width="13%"></td>
                        <td width="24%"></td>
                        <td width="13%"></td>
                        <td width="13%"></td>
                    </tr>
                    <tr>
                        <td class="th8">项目名称</td>
                        <td colspan="2">
                            <input name="prjName" class="layui-input formData1" autocomplete="off">
                        </td>
                        <td class="th8">单位工程名称</td>
                        <td colspan="2">
                            <input name="unitPrjName" class="layui-input formData1" autocomplete="off">
                        </td>
                    </tr>
                    <tr>
                        <td class="th8">建设地点</td>
                        <td colspan="2">
                            <input name="address" class="layui-input formData1" autocomplete="off">
                        </td>
                    </tr>
                    <tr>
                        <td class="th8">结构类型</td>
                        <td colspan="2">
                            <input name="jglx" class="layui-input formData1" autocomplete="off">
                        </td>
                        <td class="th8">工程描述</td>
                        <td colspan="2">
                            <input name="gcms" class="layui-input formData1" autocomplete="off">
                        </td>
                    </tr>
                    <tr>
                        <td class="th8">工程施工许可证号</td>
                        <td colspan="2">
                            <input name="gcsgxkzh" class="layui-input formData1" autocomplete="off">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <!--工程质量责任主体及主要负责人-->
    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">工程质量责任主体及主要负责人</h2>
            <div class="layui-colla-content layui-show">
                <div class="layui-tab">
                    <ul class="layui-tab-title">
                        <li class="layui-this">建设单位</li>
                        <li>施工单位</li>
                        <li>监理单位</li>
                        <li>勘察单位</li>
                        <li>设计单位</li>
                        <li>检测单位</li>
                        <li>施工图审查单位</li>
                        <li>预拌混凝土单位</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <table class="layui-table v-table">
                                <tbody>
                                <tr class="hide">
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                </tr>
                                <tr>
                                    <td class="th8">单位名称</td>
                                    <td>
                                        <input name="jsOrgName" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资质等级</td>
                                    <td>
                                        <input name="jsOrgZzdj" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">法定代表人</td>
                                    <td>
                                        <input name="jsOrgFddbr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="th8">工程项目负责人</td>
                                    <td>
                                        <input name="jsOrgGcxmfzr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书名称</td>
                                    <td>
                                        <input name="jsOrgZgzsmc" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书编号</td>
                                    <td>
                                        <input name="jsOrgZgzsbh" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-tab-item">
                            <table class="layui-table v-table">
                                <tbody>
                                <tr class="hide">
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                </tr>
                                <tr>
                                    <td class="th8">单位名称</td>
                                    <td>
                                        <input name="sgOrgName" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资质等级</td>
                                    <td>
                                        <input name="sgOrgZzdj" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">法定代表人</td>
                                    <td>
                                        <input name="sgOrgFddbr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="th8">工程项目负责人</td>
                                    <td>
                                        <input name="sgOrgGcxmfzr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书名称</td>
                                    <td>
                                        <input name="sgOrgZgzsmc" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书编号</td>
                                    <td>
                                        <input name="sgOrgZgzsbh" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-tab-item">
                            <table class="layui-table v-table">
                                <tbody>
                                <tr class="hide">
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                </tr>
                                <tr>
                                    <td class="th8">单位名称</td>
                                    <td>
                                        <input name="jlOrgName" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资质等级</td>
                                    <td>
                                        <input name="jlOrgZzdj" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">法定代表人</td>
                                    <td>
                                        <input name="jlOrgFddbr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="th8">工程项目负责人</td>
                                    <td>
                                        <input name="jlOrgGcxmfzr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书名称</td>
                                    <td>
                                        <input name="jlOrgZgzsmc" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书编号</td>
                                    <td>
                                        <input name="jlOrgZgzsbh" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-tab-item">
                            <table class="layui-table v-table">
                                <tbody>
                                <tr class="hide">
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                </tr>
                                <tr>
                                    <td class="th8">单位名称</td>
                                    <td>
                                        <input name="kcOrgName" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资质等级</td>
                                    <td>
                                        <input name="kcOrgZzdj" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">法定代表人</td>
                                    <td>
                                        <input name="kcOrgFddbr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="th8">工程项目负责人</td>
                                    <td>
                                        <input name="kcOrgGcxmfzr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书名称</td>
                                    <td>
                                        <input name="kcOrgZgzsmc" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书编号</td>
                                    <td>
                                        <input name="kcOrgZgzsbh" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-tab-item">
                            <table class="layui-table v-table">
                                <tbody>
                                <tr class="hide">
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                </tr>
                                <tr>
                                    <td class="th8">单位名称</td>
                                    <td>
                                        <input name="sjOrgName" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资质等级</td>
                                    <td>
                                        <input name="sjOrgZzdj" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">法定代表人</td>
                                    <td>
                                        <input name="sjOrgFddbr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="th8">工程项目负责人</td>
                                    <td>
                                        <input name="sjOrgGcxmfzr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书名称</td>
                                    <td>
                                        <input name="sjOrgZgzsmc" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书编号</td>
                                    <td>
                                        <input name="sjOrgZgzsbh" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-tab-item">
                            <table class="layui-table v-table">
                                <tbody>
                                <tr class="hide">
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                </tr>
                                <tr>
                                    <td class="th8">单位名称</td>
                                    <td>
                                        <input name="jcOrgName" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资质等级</td>
                                    <td>
                                        <input name="jcOrgZzdj" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">法定代表人</td>
                                    <td>
                                        <input name="jcOrgFddbr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="th8">工程项目负责人</td>
                                    <td>
                                        <input name="jcOrgGcxmfzr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书名称</td>
                                    <td>
                                        <input name="jcOrgZgzsmc" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书编号</td>
                                    <td>
                                        <input name="jcOrgZgzsbh" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-tab-item">
                            <table class="layui-table v-table">
                                <tbody>
                                <tr class="hide">
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                </tr>
                                <tr>
                                    <td class="th8">单位名称</td>
                                    <td>
                                        <input name="stOrgName" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资质等级</td>
                                    <td>
                                        <input name="stOrgZzdj" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">法定代表人</td>
                                    <td>
                                        <input name="stOrgFddbr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="th8">工程项目负责人</td>
                                    <td>
                                        <input name="stOrgGcxmfzr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书名称</td>
                                    <td>
                                        <input name="stOrgZgzsmc" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书编号</td>
                                    <td>
                                        <input name="stOrgZgzsbh" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-tab-item">
                            <table class="layui-table v-table">
                                <tbody>
                                <tr class="hide">
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                    <td width="16%"></td>
                                </tr>
                                <tr>
                                    <td class="th8">单位名称</td>
                                    <td>
                                        <input name="ybhntOrgName" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资质等级</td>
                                    <td>
                                        <input name="ybhntOrgZzdj" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">法定代表人</td>
                                    <td>
                                        <input name="ybhntOrgFddbr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="th8">工程项目负责人</td>
                                    <td>
                                        <input name="ybhntOrgGcxmfzr" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书名称</td>
                                    <td>
                                        <input name="ybhntOrgZgzsmc" class="layui-input formData1" autocomplete="off">
                                    </td>
                                    <td class="th8">资格证书编号</td>
                                    <td>
                                        <input name="ybhntOrgZgzsbh" class="layui-input formData1" autocomplete="off">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </form>

    <form id="form" class="layui-form layui-form-pane" action="" lay-filter="example">
        <input type="hidden" name="id" class="formData" value="">
        <input type="hidden" name="cptId" class="formData" value="">

        <!--建设工程质量监督情况-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">建设工程质量监督情况</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8 required">工程监督抽查情况</td>
                            <td colspan="5">
                                <input name="ccqk" class="layui-input formData" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">工程情况备注</td>
                            <td colspan="5">
                                <input name="qkbz" class="layui-input formData" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">工程竣工验收监督情况</td>
                            <td colspan="5">
                                <input name="jdqk" class="layui-input formData" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">竣工验收合格时间</td>
                            <td colspan="5">
                                <input id="qualifiedDate" name="qualifiedDate" class="layui-input formData" autocomplete="off" readonly>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <h2 class="layui-colla-title">工程质量监督人员</h2>
                <div class="layui-colla-content layui-show">
                    <script type="text/html" id="toolbarOrg">
                        <div class="layui-btn-container">
                            <input type="button"class="layui-btn" lay-event="add" value="新建">
                        </div>
                    </script>
                    <script type="text/html" id="toolbarOrg2">
                        <div class="layui-btn-container">
                            <!--不能修改-->
                        </div>
                    </script>
                    <script type="text/html" id="barDemo">
                        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
                        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="delete">删除</a>
                    </script>
                    <script type="text/html" id="barDemo2">
                        <!--不能修改-->
                    </script>
                    <table class="layui-hide" id="dataList" lay-filter="dataList"></table>
                </div>

                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8 required">监督工作起止日期</td>
                            <td colspan="3">
                                <input name="superviseStartDate" id="superviseStartDate" placeholder="开始日期" autocomplete="off" class="layui-input formData" lay-verify="required" readonly>
                                &nbsp;-&nbsp;
                                <input name="superviseEndDate" id="superviseEndDate" placeholder="结束日期" autocomplete="off" class="layui-input formData" lay-verify="required" readonly>
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">监督机构审核意见</td>
                            <td colspan="5">
                                <input name="auditOpinion" class="layui-input formData" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">审核日期</td>
                            <td colspan="3">
                                <input id="auditDate" name="auditDate" class="layui-input formData" autocomplete="off" readonly>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

            </div>
        </div>
    </form>
</div>
<script src="/static/js/main.js"></script>
<script type="text/javascript">
    var $;
    layui.use(['jquery', 'element', 'form', 'laydate', 'configure', 'configureCom', 'selectFun', 'bluebird', 'replaceStr', 'jsDictFile', 'mapExtend'], function () {
        $ = layui.jquery;
        var element = layui.element;
        var form = layui.form;
        var configure = layui.configure;
        var table = layui.table;
        var configureCom = layui.configureCom;
        var laydate = layui.laydate;
        var selectFun = layui.selectFun;
        var sessionFun = layui.sessionFun;//存储session
        var listData = sessionFun.get(configure.COMPLETION_ROW_DATA);
        var token = sessionFun.get(configure.SESSION_TOKEN) ? sessionFun.get(configure.SESSION_TOKEN).token : '';
//        var id = '';
        var auditDate = '';

        var cptAcceptanceId = sessionFun.get('cptAcceptanceId');
        laydate.render({
            elem: '#superviseStartDate',
            type: 'date'
        });

        laydate.render({
            elem: '#superviseEndDate',
            type: 'date'
        });


//        configureCom.getAjax(configure.CPT_ACCEPTANCE_CONDITION_VIEW_API,{cptAcceptanceId:cptAcceptanceId}).then(function(res){
//            if(!res.data){
//                res.data = { id: cptAcceptanceId};
//            }
//            form.val('example', res.data);
//        })
        //申请记录进来的, 赋值申请ID
        if (listData) {
            cptAcceptanceId = listData.id;
        }
        //根据申请ID查询条件核查记录
        var res={};
        var data1 = $.extend({cptAcceptanceId:cptAcceptanceId}, {token: token});
        var index = top.layer.load(1, {shade: 0.01});
        $.ajax({
            url: configure.CPT_ACCEPTANCE_SUPERVISE_REPORT_VIEW_API,
            type: 'get',
            cache: false,
            async:false,
            data: data1,
            dataType: 'json',
            success: function (data) {
                top.layer.close(index);
                res = data;
            },
            error: function (data) {
                top.layer.close(index);
            }
        });

        //如果查到条件核查记录表单赋值
        if(res.data && res.data.id){
//            id =  res.data.id
            form.val('example', res.data);
        }else{
            id = guid();
            //如果没有查到核查记录 则为新增, 表单赋值仅有申请ID
            var newData = { cptId: cptAcceptanceId};
//            newData.id = id;
            form.val('example', newData);
        }


        /**
         * 初始化项目信息
         *
         * */
        $.ajax({
            url: '/api/cpt/acceptance/report/prjInfo?token='+token,
            type: 'get',
            cache: false,
            async:true,
            data: {cptId:cptAcceptanceId},
            dataType: 'json',
            success: function (data) {
                res = data;
                //如果查到项目信息
                if(data.code==0){
                    form.val('example2', res.data);
                }else{
                    console.log('查询项目信息错误:'+res.msg);
                }
            },
            error: function (data) {
                console.log('查询项目信息异常,cptAcceptanceId:'+cptAcceptanceId);
            }
        });

        laydate.render({
            elem: '#auditDate',
            type: 'date',
            value: new Date()
        });
        laydate.render({
            elem: '#qualifiedDate',
            type: 'date',
            value: new Date()
        });

        form.render();


        /**
         * 工程质量监督人员
         */
        var cols = [[
            {field: 'name', title: '姓名'},
            {field: 'postType', title: '岗位类别' },
            {field: 'postNo', title: '监督员岗位证件号码'},
            {field: 'certificatesNo', title: '监督员行政执法证件号码'},
            {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 320}
        ]];
        var cols2 = [[
            {field: 'name', title: '姓名'},
            {field: 'postType', title: '岗位类别' },
            {field: 'postNo', title: '监督员岗位证件号码'},
            {field: 'certificatesNo', title: '监督员行政执法证件号码'},
            {fixed: 'right', title: '操作', toolbar: '#barDemo2', width: 320}
        ]];
        if(!status || status==0){
            configureCom.tableRenderGet(configure.CPT_ACCEPTANCE_SUPERVISE_TEAM_LIST_API, {cptId: cptAcceptanceId}, cols, 'dataList', 10, '', 'toolbarOrg',false);
        }else{
            configureCom.tableRenderGet(configure.CPT_ACCEPTANCE_SUPERVISE_TEAM_LIST_API, {cptId: cptAcceptanceId}, cols2, 'dataList', 10, '', 'toolbarOrg2',false);
        }
        //头工具栏事件
        table.on('toolbar(dataList)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_LIST_DATA, null);
                    editItem('工程质量监督人员', configure.CPT_ACCEPTANCE_SUPERVISE_TEAM_EDIT_HTML, configure.CPT_ACCEPTANCE_SUPERVISE_TEAM_SAVE_API);
                    break;
            }
        });
        //查看详情字典详情
        function editItem(title, htmlUrl, srvUrl) {
            top.layer.open({
                type: 2,
                title: title,
                area: configureCom.Psize2,
                content: configureCom.nocache(htmlUrl),
                btn: ['保存'],
                yes: function (index, layero) {
                    var iframeWin = top.window.frames['layui-layer-iframe' + index]; //得到iframe页的窗口对
                    var data = iframeWin.getData();
                    //保存验收记录小组关联申请ID
                    data.cptId = cptAcceptanceId;
                    configureCom.postDataAjax(srvUrl, data).then(function (res) {
                        if (res.code == 0) {
                            top.layer.close(index);
                            top.layer.msg('保存成功！');
                        } else {
                            top.layer.alert('保存失败！');
                        }
                    });
                },
                end: function () {
                    configureCom.tableReloadById('dataList');
                }
            });
        }
        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete') {
                //删除各专业验收组
                $.ajax({
                    type: "DELETE",
                    url: configure.CPT_ACCEPTANCE_SUPERVISE_TEAM_REMOVE_API+'/'+data.id+'?token='+token,
                    data: {
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById('dataList');
                    }
                });
            }else if(obj.event === 'edit'){
                sessionFun.set(configure.SESSION_LIST_DATA, data);
                editItem('工程质量监督人员', configure.CPT_ACCEPTANCE_SUPERVISE_TEAM_EDIT_HTML, configure.CPT_ACCEPTANCE_SUPERVISE_TEAM_SAVE_API);
            }
        });

    });

    function getData() {
        return new Promise(function (res, rej) {
            var data = {};
            if (!window.formVerifyFun()) {
                //return false;
            }

            $('.formData').each(function (index, item) {
                var key = $(item).attr('name');
                var type = $(item).attr('type');
                if(type=='radio'){
                    data[key] = $("input[name='"+key+"']:checked").val();
                }else{
                    data[key] = $(item).val();
                }

            });
            res({result: data});
        });
    }

    function guid() {
        uid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
            var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
            return v.toString(16);
        });
        return uid.replace(/-/g,'');
    };

</script>
</body>
</html>
